export default {
  methods: {
    // 逆时针旋转
    anticlockwiseList (list) {
      const arr = [[], [], [], []]
      for (let row = 0; row < list.length; row++) {
        for (let col = 0; col < list[row].length; col++) {
          arr[row].push(list[col][arr.length - 1 - row])
        }
      }
      return arr
    },
    // 顺时针旋转
    clockwiseList (list) {
      const arr = [[], [], [], []]
      for (let row = 0; row < list.length; row++) {
        for (let col = 0; col < list[row].length; col++) {
          arr[row].push(list[arr.length - col - 1][row])
        }
      }
      return arr
    },
    // 翻转
    reverseList (list) {
      const arr = [[], [], [], []]
      for (let row = 0; row < list.length; row++) {
        for (let col = 0; col < list[row].length; col++) {
          arr[row].push(list[row][list[row].length - col - 1])
        }
      }
      return arr
    }
  }
}
